﻿<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>人员信息添加</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
    <link rel="stylesheet" href="../../../static/css/font.css">
    <link rel="stylesheet" href="../../../static/css/weadmin.css">
    <!-- 让IE8/9支持媒体查询，从而兼容栅格 -->
    <!--[if lt IE 9]>
      <script src="https://cdn.staticfile.org/html5shiv/r29/html5.min.js"></script>
      <script src="https://cdn.staticfile.org/respond.js/1.4.2/respond.min.js"></script>
    <![endif]-->
</head>
<body>
    <div class="weadmin-body">
        <form class="layui-form">
            <div class="layui-form-item">
                <label for="UserID" class="layui-form-label">
                    <span class="we-red">*</span>用户名
                </label>
                <div class="layui-input-inline">
                    <input type="text" id="UserID" name="UserID" lay-verify="required" autocomplete="off" class="layui-input" readonly="readonly">
                </div>

                <label for="UserName" class="layui-form-label">
                    <span class="we-red">*</span>姓名
                </label>
                <div class="layui-input-inline">
                    <input type="text" id="UserName" name="UserName" lay-verify="required" autocomplete="off" class="layui-input" readonly="readonly">
                </div>
                <label for="DepName" class="layui-form-label">
                    <span class="we-red">*</span>部门
                </label>
                <div class="layui-input-inline">
                    <input id="DepName" name="DepName" autocomplete="off" class="layui-input" readonly="readonly">
                </div>
                <!--<label for="UserSFZH" class="layui-form-label">
        <span class="we-red">*</span>身份证号
    </label>
    <div class="layui-input-inline">
        <input type="text" id="UserSFZH" name="UserSFZH" lay-verify="required|sfzh" autocomplete="off" class="layui-input" readonly="readonly">
    </div>
    <label for="EmpID" class="layui-form-label">
        <span class="we-red">*</span>人员编号
    </label>
    <div class="layui-input-inline">
        <input type="text" id="UserNo" name="UserNo" lay-verify="required" autocomplete="off" class="layui-input" readonly="readonly">
    </div>-->
            </div>

            <!--<div class="layui-form-item">
        <label for="UserPwd" class="layui-form-label">
            <span class="we-red">*</span>登录密码
        </label>
        <div class="layui-input-inline">
            <input type="password" id="UserPwd" name="UserPwd" lay-verify="required|pass" autocomplete="off" class="layui-input">
        </div>
        <label for="ReUserPwd" class="layui-form-label">
            <span class="we-red">*</span>确认密码
        </label>
        <div class="layui-input-inline">
            <input type="password" id="ReUserPwd" name="ReUserPwd" lay-verify="required|repass" autocomplete="off" class="layui-input">
        </div>
    </div>-->
            <div class="layui-form-item">
                <label for="Sex" class="layui-form-label">性别</label>
                <div class="layui-input-inline" id="EmpSex">
                    <input type="radio" name="Sex" value="男" title="男" checked>
                    <input type="radio" name="Sex" value="女" title="女">
                </div>
                <label for="Nation" class="layui-form-label">
                    民族
                </label>
                <div class="layui-input-inline">
                    <input id="Nation" name="Nation" autocomplete="off" class="layui-input" readonly="readonly">
                </div>
                <label for="RoleName" class="layui-form-label">
                    角色
                </label>
                <div class="layui-input-inline">
                    <input id="RoleName" name="Post" autocomplete="off" class="layui-input" readonly="readonly">
                </div>
            </div>

            <div class="layui-form-item">

                <label for="Post" class="layui-form-label">
                    职务
                </label>
                <div class="layui-input-inline">
                    <input id="Post" name="Post" autocomplete="off" class="layui-input" readonly="readonly">
                </div>
                <label for="Post" class="layui-form-label">
                    指导组
                </label>
                <div class="layui-input-inline">
                    <input id="Groups" name="Groups" autocomplete="off" class="layui-input" readonly="readonly">
                </div>
            </div>
            <!--<div class="layui-form-item">
        <div class="layui-input-block">
            <button class="layui-btn" lay-submit="" lay-filter="add">确定</button>
        </div>
    </div>-->
        </form>
    </div>
    <script src="../../../lib/layui/layui.js" charset="utf-8"></script>
    <script src="../../../static/js/common.js" charset="utf-8"></script>
    <script>
        layui.use(['form', 'jquery', 'layer', 'laydate'], function () {
            var form = layui.form,
                $ = layui.jquery,
                layer = layui.layer,
                laydate = layui.laydate;
            $.support.cors = true;
            $.ajaxSetup({
                cache: false,
                headers: {
                    "userid": JSON.parse(window.localStorage.authInfo).UserId,
                    "signtoken": JSON.parse(window.localStorage.authInfo).SignToken,
                },
            })
            //日期时间选择器
            laydate.render({
                elem: '#Birthday'
                //, type: 'datetime'
            });
            //日期时间选择器
            laydate.render({
                elem: '#BeginWorkDate'
                //, type: 'datetime'
            });
            //日期时间选择器
            laydate.render({
                elem: '#AppointmentDate'
                //, type: 'datetime'
            });
            //日期时间选择器
            laydate.render({
                elem: '#InTime'
                //, type: 'datetime'
            });

            $(function () {
                //加载民族
                //var nations = ["汉族", "蒙古族", "回族", "藏族", "维吾尔族", "苗族", "彝族", "壮族", "布依族", "朝鲜族", "满族", "侗族", "瑶族", "白族", "土家族",
                //    "哈尼族", "哈萨克族", "傣族", "黎族", "傈僳族", "佤族", "畲族", "高山族", "拉祜族", "水族", "东乡族", "纳西族", "景颇族", "柯尔克孜族",
                //    "土族", "达斡尔族", "仫佬族", "羌族", "布朗族", "撒拉族", "毛南族", "仡佬族", "锡伯族", "阿昌族", "普米族", "塔吉克族", "怒族", "乌孜别克族",
                //    "俄罗斯族", "鄂温克族", "德昂族", "保安族", "裕固族", "京族", "塔塔尔族", "独龙族", "鄂伦春族", "赫哲族", "门巴族", "珞巴族", "基诺族"];
                //var staff_nation = document.getElementById("Nation");
                //for (var i in nations) {
                //    staff_nation.add(new Option(nations[i], nations[i]));
                //}
                //form.render();
                //加载部门信息，角色信息，机务段信息

                $.ajax({
                    url: ApiUrl + "UserInfo/GetUserInfoDetail",
                    type: 'get',
                    dataType: 'json',
                    cache: false,
                    headers: {
                        "userid": JSON.parse(window.localStorage.authInfo).UserId,
                        "signtoken": JSON.parse(window.localStorage.authInfo).SignToken,
                    },
                    data: { id: getUrlParam("FID") },
                    success: function (data) {
                        if (data.StatusCode == 200 && data.Count != 0) {
                            $.each(data.Data[0], function (name, value) {
                                $("#" + name).val(value);
                            });
                        }
                        else if (data.StatusCode == 403) {
                            top.layer.alert(data.Info + ",请重新登录！", { closeBtn: 0 }, function () {
                                top.location.href = "http://" + top.location.host + "/login.html";
                            })
                        }
                        else {
                            layer.msg(data.Info);
                        }
                    }
                });
            });

        });
    </script>
</body>
</html>